home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
201-225
/
disk_222
/
plplot
/
src
/
source.zoo
/
strpos.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-15
|
487b
|
20 lines
/* Searches string str for first occurence of character chr. If found */
/* the position of the character in the string is returned (the first */
/* character has position 0). If the character is not found a -1 is */
/* returned. */
#include "plplot.h"
#include <stdio.h> /* Needed to define NULL */
#include <string.h>
int strpos(str,chr)
char *str,chr;
{
char *temp;
if ( (temp = strchr(str,chr)) != NULL)
return(temp - str);
else
return(-1);
}